﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../scripts/boot.js" type="text/javascript"></script>
    <script type="text/javascript">
        $.ajax({
            url: "../data/system.aspx?method=48",
            async: false,
            success: function (text) {
                if (text == "no")
                    window.location = "error.html";
            }
        });
        $(document).ready(function () {
            $.ajax({
                url: "../data/system.aspx?method=GetWebset",
                success: function (text) {
                    if (text == "out") {
                        var loginWindow = parent.mini.get("loginWindow");
                        if (!loginWindow.visible)
                            loginWindow.show();
                        var tabs = parent.mini.get("mainTabs");
                        var tab = tabs.getTab("tab$48");
                        tabs.removeTab(tab);
                    }
                    var form = new mini.Form("editform");
                    var o = mini.decode(text);
                    form.setData(o);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    ShowMessage("系统提示", "页面加载失败！", 3);
                }
            });
        });
    </script>
</head>
<body>
    <div class="mini-fit" align="center">
        <fieldset style="width:600px;border:solid 1px #aaa;margin-top:8px;">
            <legend><strong>网站基本信息设置 </strong><span class="red">( 带 * 号的必须填写)</span></legend>
            <div id="editform" style="padding:5px;">
                <input class="mini-hidden" name="ws_no"/>
                <table style="width:100%;">
                    <tr>
                        <td class="tdtitle" style="width:20%;"><span class="red">*</span>网站名称：</td>
                        <td><input name="ws_title" class="mini-textbox" required="true" style="width:400px;"/></td>
                    </tr>
                    <tr>
                        <td class="tdtitle">网站描述：</td>
                        <td><input name="ws_bewrite" class="mini-textbox" style="width:400px;"/></td>
                    </tr>
                    <tr>
                        <td class="tdtitle"><span class="red">*</span>keyword：</td>
                        <td><input name="ws_keyword" class="mini-textbox" required="true" style="width:400px;"/></td>
                    </tr>
                    <tr>
                        <td class="tdtitle"><span class="red">*</span>description：</td>
                        <td><input name="ws_description" class="mini-textbox" required="true" style="width:400px;"/></td>
                    </tr>
                    <tr>
                        <td class="tdtitle"><span class="red">*</span>域名：</td>
                        <td><input name="ws_url" class="mini-textbox" required="true" style="width:400px;"/></td>
                    </tr>
                    <tr>
                        <td class="tdtitle"><span class="red">*</span>网站单位：</td>
                        <td><input name="ws_company" class="mini-textbox" required="true" style="width:400px;"/></td>
                    </tr>
                    <tr>
                        <td class="tdtitle"><span class="red">*</span>网站主办方：</td>
                        <td><input name="ws_sponsor" class="mini-textbox" required="true" style="width:400px;"/></td>
                    </tr>
                    <tr>
                        <td class="tdtitle"><span class="red">*</span>联系地址：</td>
                        <td><input name="ws_address" class="mini-textbox" required="true" style="width:400px;"/></td>
                    </tr>
                    <tr>
                        <td class="tdtitle"><span class="red">*</span>邮编：</td>
                        <td><input name="ws_zip" class="mini-textbox" required="true" style="width:400px;"/></td>
                    </tr>
                    <tr>
                        <td class="tdtitle"><span class="red">*</span>联系电话：</td>
                        <td><input name="ws_tel" class="mini-textbox" required="true"/ style="width:400px;"/></td>
                    </tr>
                    <tr>
                        <td class="tdtitle"><span class="red">*</span>Email：</td>
                        <td><input name="ws_email" class="mini-textbox" required="true" style="width:400px;"/></td>
                    </tr>
                    <tr>
                        <td class="tdtitle"><span class="red">*</span>ICP：</td>
                        <td><input name="ws_icp" class="mini-textbox" required="true" style="width:400px;"/></td>
                    </tr>
                    <tr>
                        <td class="tdtitle">统计代码：</td>
                        <td><input name="ws_script" class="mini-textarea" style="width:400px; height:60px;"/></td>
                    </tr>
                    <tr>
                        <td colspan="2" style="text-align:center;padding:5px;"><a class="mini-button" onclick="onClick" style="width:60px;">保存</a></td>
                    </tr>
                </table>
            </div>
        </fieldset>
    </div>
</body>
    <script type="text/javascript">
        $.ajaxSetup({
            contentType: "application/x-www-form-urlencoded;charset=utf-8",
            complete: function (XMLHttpRequest, textStatus) {
                // 通过XMLHttpRequest取得响应头，sessionstatus
                var sessionstatus = XMLHttpRequest.getResponseHeader("sessionstatus");
                if (XMLHttpRequest.responseText == "out") {
                    var loginWindow = parent.mini.get("loginWindow");
                    if (!loginWindow.visible)
                        loginWindow.show();
                }
            }
        });
        mini.parse();

        function onClick() {
            var form = new mini.Form("editform");
            form.validate();
            if (form.isValid() == false) return;
            //提交数据
            var data = form.getData();
            var json = mini.encode(data);
            var messageid = mini.loading("操作中，请稍后......", "系统提示");
            $.ajax({
                url: "../data/system.aspx?method=SaveWebset",
                data: { data: json },
                type: "post",
                success: function (ret) {
                    mini.hideMessageBox(messageid);
                    if (ret >= 0)
                        ShowMessage("系统提示", "保存成功！", 1);
                    else
                        ShowMessage("系统提示", "保存失败！", 3);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    mini.hideMessageBox(messageid);
                    ShowMessage("系统提示", "保存失败！", 3);
                }
            });
        }
    </script>
</html>
